
    function fun_name()
        {
            str=document.getElementById("cname").value;
            var f=0;
            var f2=0;
            var l=parseInt(str.length);

            for(var i=0;i<l;i++)
            {
                 var ch=str.charAt(i);
                 if(ch=='.'|| ch=='_' || ch==',' || ch=='!' || ch=='@' || ch=='#' || ch=='$' || ch=='%' || ch=='^' || ch=='~' || ch=='`' || ch=='&' || ch=='*' || ch=='(' || ch==')' || ch=='-' || ch=='=' || ch=='+' || ch=='[' || ch==']' || ch=='{' || ch=='}' || ch=='|' || ch=='\\' || ch=='/' || ch==':' || ch==';' || ch=='"' || ch=='\'' || ch=='?' || ch=='>' || ch=='<')
                  {
                        f=1;
                  }
                  if(str.charAt(0)==' ')
                  {
                        f=1;
                  }
            }
            if(f==1)
            {
                    document.getElementById("name").innerHTML ="Enter Correct Name.";
            }
            else
            {
                    document.getElementById("name").innerHTML ="";
            }
             if(l>25 && f==0)
            {
                     document.getElementById("name").innerHTML ="Name Should Not Be Greater Than 25 Characters.";
                     f2=1;
            }
             if(f==0 && f2==0)
               return true;
           else
               return false;

        }
      function fun_name1()
      {
          str=document.getElementById("cname").value;
          var f=0;
          if(str.length==0)
           {
                f=1;
                document.getElementById("name").innerHTML ="Enter Name.";
           }
            if(f==0)
               return true;
           else
               return false;
      }


      function fun_fname()
          {
              str=document.getElementById("fname").value;
              var f=0;
              var f2=0;
              var l=parseInt(str.length);

              for(var i=0;i<l;i++)
              {
                   var ch=str.charAt(i);
                   if(ch=='.'|| ch=='_' || ch==',' || ch=='!' || ch=='@' || ch=='#' || ch=='$' || ch=='%' || ch=='^' || ch=='~' || ch=='`' || ch=='&' || ch=='*' || ch=='(' || ch==')' || ch=='-' || ch=='=' || ch=='+' || ch=='[' || ch==']' || ch=='{' || ch=='}' || ch=='|' || ch=='\\' || ch=='/' || ch==':' || ch==';' || ch=='"' || ch=='\'' || ch=='?' || ch=='>' || ch=='<')
                    {
                          f=1;
                    }
                    if(str.charAt(0)==' ')
                    {
                          f=1;
                    }
              }
              if(f==1)
              {
                      document.getElementById("fathername").innerHTML ="Enter Correct Name.";
              }
              else
              {
                      document.getElementById("fathername").innerHTML ="";
              }
               if(l>25 && f==0)
              {
                       document.getElementById("fathername").innerHTML ="Name Should Not Be Greater Than 25 Characters.";
                       f2=1;
              }
               if(f==0 && f2==0)
                 return true;
             else
                 return false;

          }
        function fun_fname1()
        {
            str=document.getElementById("fname").value;
            var f=0;
            if(str.length==0)
             {
                  f=1;
                  document.getElementById("fathername").innerHTML ="Enter Father's Name.";
             }
              if(f==0)
                 return true;
             else
                 return false;
        }


        function fun_email()
        {
            str=document.getElementById("email").value;
            var f=0;
            var f1=0;
            var l=parseInt(str.length);

            for(var i=0;i<l;i++)
            {
                 var ch=str.charAt(i);
                 if(ch=='!' || ch=='#' || ch=='$' || ch=='%' || ch=='^' || ch=='~' || ch=='`' || ch=='&' || ch=='*' || ch=='(' || ch==')' || ch=='-' || ch=='=' || ch=='+' || ch=='[' || ch==']' || ch=='{' || ch=='}' || ch=='|' || ch=='\\' || ch=='/' || ch==':' || ch==';' || ch=='"' || ch=='\'' || ch=='?' || ch=='>' || ch=='<')
                  {
                        f=1;
                  }
                  if(ch==' ')
                  {
                        f1=1;
                  }
            }
            if(f==1)
            {
                    document.getElementById("mail").innerHTML ="Enter Correct Email Address.";
            }
            else if(f1==1)
            {
                    document.getElementById("mail").innerHTML ="Space Is Not Allowed.";
            }
            else
            {
                    document.getElementById("mail").innerHTML ="";
            }
             if(f==0 && f1==0)
               return true;
           else
               return false;


        }
      function fun_email1()
      {
          var f=0;
          var f1=0,f2=0;
          str=document.getElementById("email").value;
          if(str.length==0)
          {
        	  f=1;
              document.getElementById("mail").innerHTML ="Enter Email Address.";
          }
          else if(str.indexOf('@')<0 || str.indexOf('.')<0 || str.indexOf('.',str.indexOf('@')+2)<0 || str.charAt(0)=='@')
          {
              f1=1;
              document.getElementById("mail").innerHTML ="Enter Correct Email Address.";
          }
          else if(str.length>30)
          {
              f2=1;
              document.getElementById("mail").innerHTML ="Please Enter Normal Sized Email Address.";
          }
          else
          {
        	  document.getElementById("mail").innerHTML ="";
                  
          }
           if(f==0 && f1==0 && f2==0)
               return true;
           else
               return false;
      }

      function fun_address()
      {
    	  var f=0;
    	  str=document.getElementById("address").value;
    	  if(str.length<=10)
    	  {
    		  f=1;
    		  document.getElementById("add").innerHTML="Enter Valid Address.";
    	  }
    	  else
    	  {
    		  document.getElementById("add").innerHTML="";
    	  }
          if(f==0)
              return true;
          else
              return false;
      }


    
      function fun_pincode()
      {
    	  var f=0;
    	  str=document.getElementById("pincode").value;
    	  var l=parseInt(str.length);

          for(var i=0;i<l;i++)
          {
               var ch=str.charAt(i);
               if(ch=='!' || ch=='#' || ch=='$' || ch=='%' || ch=='^' || ch=='~' || ch=='`' || ch=='&' || ch=='*' || ch=='(' || ch==')' || ch=='-' || ch=='=' || ch=='+' || ch=='[' || ch==']' || ch=='{' || ch=='}' || ch=='|' || ch=='\\' || ch=='/' || ch==':' || ch==';' || ch=='"' || ch=='\'' || ch=='?' || ch=='>' || ch=='<')
                {
                      f=1;
                }
                if(ch==' ')
                {
                      f=1;
                }
          }
          if(f==1)
          {
        	  document.getElementById("pin").innerHTML ="Enter Correct Pincode.";
          }
          else
          {
        	  document.getElementById("pin").innerHTML ="";
          }
          if(f==0)
              return true;
          else
              return false;
      }
      
      function fun_city()
      {
    	  var f=0;
    	  var c=(contact.city.value);
    	  if(c=='Select')
    	  {
    		  f=1;
    		  document.getElementById("citi").innerHTML="Please Select City.";
    	  }
    	  else
    	  {
    		  document.getElementById("citi").innerHTML="";
    	  }
          if(f==0)
              return true;
          else
              return false;
      }
      
      function fun_pincode1()
      {
    	  var f=0;
    	  str=document.getElementById("pincode").value;

    	  if(str.length==0)
          {
   			  document.getElementById("pin").innerHTML="";
          }
    	  else if(str.length==6)
    	  {
  		  	document.getElementById("pin").innerHTML="";
    	  }    	  
    	  else
    	  {
    		  f=1;
    		  document.getElementById("pin").innerHTML="Enter Valid Pincode.";
    	  }
          if(f==0)
              return true;
          else
              return false;
      }
      
      function fun_resi()
      {
          var f=0;
          str=document.getElementById("residence").value;
          var l=parseInt(str.length);

          if(l>11)
          {
        	  f=1;     
        	  document.getElementById("resi").innerHTML ="Should Not Be Greater Than 11 Digits.";
          }
          else
          {
        	  document.getElementById("resi").innerHTML="";
          }
          if(f==0)
          	return true;
          else
            return false;
      }
      function fun_resi1()
      {
          str=document.getElementById("residence").value;
          var f=0;
          if(str.length==0)
          {
        	  f=1;
              document.getElementById("resi").innerHTML ="Enter Residence No.";
          }
          else if(str.length<11)
          {
        	  f=1;
        	  document.getElementById("resi").innerHTML ="Enter Correct No.";
          }
          else
          {   
              document.getElementById("resi").innerHTML ="";
          }
           if(f==0)
               return true;
           else
               return false;
      }

      function fun_mob()
      {
    	  str=document.getElementById("mobile").value;
    	  var f=0;
          var l=parseInt(str.length);
          if(l>10)
          {
              f=1;
              document.getElementById("mob").innerHTML ="Should Not Be Greater Than 10 Digits.";
          }
          else
          {
        	  document.getElementById("mob").innerHTML="";
          }
          
          if(f==0)
          	return true;
          else
            return false;
      }
      function fun_mob1()
      {
          str=document.getElementById("mobile").value;
          var f=0;
          if(str.length==0)
          {
                f=1;
                document.getElementById("mob").innerHTML ="Enter Mobile No.";
          }
          else if(str.length<10)
          {
        	  f=1;
        	  document.getElementById("mob").innerHTML ="Enter Correct Mobile No.";
          }
          else
          {   
        	  document.getElementById("mob").innerHTML ="";
          }
           if(f==0)
               return true;
           else
               return false;
      }
      
      function fun_userid()
      {
    	  var u=0;
    	  str=document.getElementById("userid").value;
    	  if(str.length==0)
    	  {
    		  u=1;
    		  document.getElementById("user").innerHTML="Enter User ID.";
    	  }
    	  else
    	  {
    		  document.getElementById("user").innerHTML ="";
    	  }
    	  if(u==0)
    		  return true;
    	  else
    		  return false;
      }

      function fun_pass()
      {
    	  var p=0;
    	  str=document.getElementById("pass").value;
    	  if(str.length==0)
    	  {
    		  p=1;
    		  document.getElementById("password").innerHTML="Enter Password.";
    	  }
    	  else
    	  {
    		  document.getElementById("password").innerHTML ="";
    	  }
    	  if(p==0)
    		  return true;
    	  else
    		  return false;
      }
      
      function validate_logon()
      {
    	  var u=0;
    	  var p=0;
    	  
    	  if(fun_userid()==true)
    		  u=1;
    	  else
              document.getElementById("user").innerHTML ="Enter User ID.";
    	  
    	  if(fun_pass()==true)
    		  p=1;
    	  else
              document.getElementById("password").innerHTML ="Enter Password.";
    		  
    	  if(u==1 && p==1)
    		  return true;
    	  else
    		  return false;
      }

      function validate()
      {
    	  var n=0;
    	  var fn=0;
    	  var e=0;
    	  var a=0;
    	  var r=0;
    	  var m=0;
    	  var c=0;
    	  
    	  if(fun_name()==true && fun_name1()==true && document.getElementById("cname").value.length!=0)
              n=1;
          else
              document.getElementById("name").innerHTML ="Enter Name.";
    	  if(fun_fname()==true && fun_fname1()==true && document.getElementById("fname").value.length!=0)
    		  fn=1;
    	  else
    		  document.getElementById("fathername").innerHTML ="Enter Father's Name.";
    	  
    	  if(fun_email()==true && fun_email1()==true && document.getElementById("email").value.length!=0)
    		  e=1;
    	  else
    		  document.getElementById("mail").innerHTML ="Enter Email Address.";
    	  
    	  if(fun_address()==true && document.getElementById("address").value.length!=0)
    		  a=1;
    	  else
    		  document.getElementById("add").innerHTML ="Enter Address.";
    	  
    	  if(fun_resi()==true && fun_resi1()==true && document.getElementById("residence").value.length!=0)
    		  r=1;
    	  else
    		  document.getElementById("resi").innerHTML ="Enter Residence No.";

    	  if(fun_mob()==true && fun_mob1()==true && document.getElementById("mobile").value.length!=0)
    		  m=1;
    	  else
    		  document.getElementById("mob").innerHTML ="Enter Mobile No.";

    	  if(fun_city()==true)
    		  c=1;
    	  else
    		  document.getElementById("citi").innerHTML="Select City.";
    	  
    	  if(n==1 && fn==1 && e==1 && a==1 && r==1 && m==1 && c==1)
              return true;
          else
              return false;
      }
      
      /*function validate()
{
	if(fun_name()==false && fun_name1()==false && fun_fname()==false &&fun_fname1()==false && fun_email()==false &&fun_email1()==false &&fun_address()==false &&fun_city()==false &&fun_pincode()==false && fun_pincode1()==false && fun_resi()==false && fun_resi1()==false && fun_mob()==false && fun_mob1()==false )
	{	alert("Please fill the required details correctly.");
	}
	else
	{
		alert("Ok");
	}
}
*/
      
  	/*  function validate()
        {
       		var n=0;
	        var fn=0;
	        var m=0;
	         var c=0;
	          var sq=0;
	          var sa=0;
	          var l=0;
	                    
          if(fun_name()==true && fun_name1()==true && document.getElementById("cname").value.length!=0)
                  n=1;
          else if(document.getElementById("cname").value.length>25)
                  document.getElementById("name").innerHTML ="Name Should Not Be Greater Than 25 Characters.";
          else if(document.getElementById("cname").value.length>0)
                  document.getElementById("name").innerHTML ="Enter Correct Name.";
          else
                  document.getElementById("name").innerHTML ="Enter Name.";
          
          if(fun_fname()==true && fun_fname()==true && document.getElementById("fname").value.length!=0)
              fn=1;
            
          if(fun_email()==true && fun_email1()==true && document.getElementById("email").value.length!=0)
                 m=1;
          else if( document.getElementById("email").value.length!=0)
              document.getElementById("mail").innerHTML ="Enter Correct Email Address.";
          else
                document.getElementById("mail").innerHTML ="Enter Email Address.";
           

          if(cno()==true && cno1()==true && document.getElementById("contact").value.length!=0)
                c=1;
          else if(document.getElementById("contact").value.length>10)
              document.getElementById("cno").innerHTML ="Should Not Length Greater Than 10 Digits.";
          else if(document.getElementById("contact").value.length!=0)
              document.getElementById("cno").innerHTML ="Enter Correct Contact No.";
          else
               document.getElementById("cno").innerHTML ="Enter Contact No.";
          
          if(document.getElementById("sques").selectedIndex!=0)
                   sq=1;
          else
                  document.getElementById("scques").innerHTML ="Select Security Ques.";
          
          if(scans()==true && scans1()==true && document.getElementById("sans").value.length!=0)
                  sa=1;
          else if(document.getElementById("sans").value.length>50)
              document.getElementById("scans").innerHTML ="Should Not Greater Than 50 Characters.";
          else
                  document.getElementById("scans").innerHTML ="Enter Security Answer.";
          if(n==1 && fn==1 && m==1)
              return true;
          else
              return false;

      }*/